package com.kyle.gateway;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;

@EnableAutoConfiguration
@EnableEurekaClient
@SpringBootApplication
@EnableZuulProxy
public class GateWayApplication {

  public static void main(String[] args) {
    SpringApplication.run(GateWayApplication.class, args);
  }

/*  @Bean
  public RouteLocator customRouteLocator(RouteLocatorBuilder locatorBuilder) {
    //builder会报红，开始我以为那个地方有错误，但是后面调试发现并没有影响
    return locatorBuilder.routes()
        .route("path_route", r -> r.path("/about")
            .uri("http://ityouknow.com"))
        .build();
  }

  @Bean
  public RouterFunction<ServerResponse> testFunRouterFunction() {
    RouterFunction<ServerResponse> route = RouterFunctions.route(
        RequestPredicates.path("/163"),
        request -> ServerResponse.ok().body(BodyInserters.fromObject("hello")));
    return route;
  }*/

}
